﻿using FarmSmartSleep.Common.Dtos;
using FarmSmartSleep.Organ.API.Application.SleepInfoCommands.ImportFarrowCommands;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace FarmSmartSleep.Organ.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ImportController : ControllerBase
    {
        private readonly IMediator mediator;

        public ImportController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 导入分娩数据
        /// </summary>
        /// <param name="cmd"></param>
        /// <returns></returns>
        [HttpPost("ImportFarrow")]
        public async Task<Result> ImportFarrow([FromQuery]ImportFarrowCommand cmd)
        {
            return await mediator.Send(cmd);
        }
    }
}
